<!DOCTYPE html>
<html lang="en">
<head>
[#include "/customer/include/static.htm"]
    <link href="${path}/resources/css/user.css?v=2" rel="stylesheet" type="text/css"/>
    <link href="${path}/resources/plug/layui/css/layui.css" rel="stylesheet" type="text/css"/>
    <script src="${path}/resources/plug/layui/layui.js" type="text/javascript"></script>
    <script class="resources library" src="${path}/resources/js/area.js" type="text/javascript"></script>
    <style type="text/css">
        option {
            font-size: 14px;
            line-height: 20px;
        }
    </style>

[#import "/customer/include/pagination.ftl" as p/]
</head>
<script>


</script>
<script>
    layui.use(['form','layer'], function(){
        var form = layui.form(), $=layui.jquery, layer = layui.layer;


    });

    function save(){
        var index = layer.load();
        var bank = $('#bank').val();
        var bank_cardno = $('#card').val();
        var s_province = $('#s_province').val();
        var s_city = $('#s_city').val();
        var s_county = $('#s_county').val();
        var branch = $('#branch').val();
        ajax({
            url:"${path}/member/bank/save",
            data:{
                'bank':bank,
                's_province':s_province,
                's_city':s_city,
                's_county':s_county,
                'branch':branch,
                'bank_cardno':bank_cardno
            },
            success: function(result){

                layer.msg(result.content,function(){  location.reload(); });

            },
            complete:function(){
                layer.close(index);
            }
        });
    }
</script>
<body>
<!--头部-->
[#include "/customer/include/header.ftl"]


<div class="member">
    <!--左边-->
[#include "/customer/include/member_left_menu.ftl"]

    <!--左边 end-->
    <div class="memberRight">
        <div class="member_tab">
            <div class="member_tab">
                <a href="/member/account/log">资金明细</a>
                <a  class="on" href="/member/account/edit">银行账户</a>
                [#--<a href="/member/account/go_recharge_offline">线下充值</a>--]
                <a href="/member/account/go_recharge_online">线上充值</a>
                <a href="/member/account/recharges">充值记录</a>
                <a href="/member/account/gocash">用户提现</a>
                <a href="/member/account/withdrawals">提现记录</a>
            </div>
        </div>
        <div class="member_tab_info">
            <table class="layui-table">
                <tbody>
                <tr>
                    <td>开户银行：</td>
                    <td>
                        <select name="bank" id="bank" name="khh" class="layui-input">
                    [@p2p_banks]
                        [#list banks as bank]
                            <option value='${bank.bank_code}'[#if ((bankCard.bank_code)!'')==bank.bank_code]selected="selected"[/#if] >
                            ${bank.bank_name}
                            </option>
                        [/#list]
                    [/@p2p_banks]
                            </select>
                    </td>
                </tr>
                <tr>
                    <td>开户支行名称：</td>
                    <td> <input type="text" class="layui-input" name="branch" id="branch" value="${(bankCard.branch)!''}" > </td>
                </tr>
                <tr>
                    <td>银行账号：</td>
                    <td> <input type="text" val=""  class="layui-input" id="card" name="bank_cardno" id="bank_cardno" value="${(bankCard.bank_cardno)!'' }"
                                onkeyup="value=value.replace(/[^\d]/g,'')" ></td>
                </tr>
                <tr>
                    <td>省市区：</td>
                    <td>
                        <div class="layui-input-inline" style="width: 210px">
                        <select id="s_province" name="s_province" class="layui-input">
                        </select>
                            </div>
                        <div class="layui-input-inline"  style="width: 210px">
                        <select id="s_city" name="s_city" class="layui-input"></select>
                        </div>
                        <div class="layui-input-inline"  style="width: 210px">
                        <select id="s_county" name="s_county" class="layui-input"></select>
                        </div>

                    </td>
                </tr>
                </tbody>

            </table>
            <div class="span10">
                [#if bankCard==null]
                <button class="layui-btn   layui-btn-danger " style="background-color: #F3485A;" lay-submit lay-filter="MainForm" type="submit"onclick="save()" >
                    确认提交
                </button>
                [/#if]
[#if bankCard!=null]
                <a href="${path}/member/bank/tounbind" style="height: 100%;width: 100%">解绑申请</a>
[/#if]

            </div>

        </div>
    </div>
</div>

<script type="text/javascript">
    var opt0 = ['${(bankCard.province)!''}','${(bankCard.city)!''}','${(bankCard.area)!''}'];//初始值
    _init_area();
</script>
<script type="text/javascript">

    var Gid  = document.getElementById ;

    var showArea = function(){
        Gid('show').innerHTML = "<h3>省" + Gid('s_province').value + " - 市" +

                Gid('s_city').value + " - 县/区" +

                Gid('s_county').value + "</h3>"

    }
    function changeBankCard(){
        window.location.href = "";
    }

</script>
[#include "/customer/include/footer.ftl"]
</body>
</html>
